package cn.com.bdqn.dao;

import cn.com.bdqn.entity.SalPlan;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SalPlanDao {

    @Insert("insert into sal_plan values\n" +
            "(default,#{plaChcId},#{plaDate},#{plaTodo},null);")
    public int addSalPlan(SalPlan salPlan);

    public int updateSalPlan(SalPlan salPlan);

    @Delete("delete from sal_plan where pla_id = #{value};")
    public int delSalPlan(Long plaId);

    @Select("select * from sal_plan where pla_chc_id = #{value};")
    public List<SalPlan> queryByPlaChcId(Long plaChcId);

    @Select("select * from sal_plan where pla_id = #{plaId}")
    public SalPlan queryByPlaId(Long plaId);

}
